require 'watir'
include Watir
require 'test/unit'
class TC_blogsFrontEnd < Test::Unit::TestCase
  	def test_48_DeleteBlogUsingBlogGroups_Blogs

  $ie.goto($UniVar)

#Create Blog
	$ie.goto($UniVar + '/controlpanel/BlogAdmin/sectionedit.aspx')	
	$ie.text_field(:id, /ctl00_ctl00_TaskRegion_SectionDetails1_SectionDetails1_SectionName/).set('rewriteblog')
	$ie.text_field(:id, /ctl00_ctl00_TaskRegion_SectionDetails1_SectionDetails1_AppKey/).set('rewriteblog')
	$ie.text_field(:id, /ctl00_ctl00_TaskRegion_SectionDetails1_SectionDetails1_Owners/).set($ADMIN)  
	$ie.link(:text, 'Save').click
  
#Test Specifics
	$ie.goto($UniVar + '/controlpanel/BlogAdmin/Groups.aspx')		
  $ie.link(:index, 21).click

  $ie.wait()
  $ie.link(:text, 'Delete').flash  
  $ie.link(:text, 'Delete').click_no_wait
  hwnd = $ie.enabled_popup(5)
  if(hwnd)
  w = WinClicker.new
  w.clickWindowsButton_hwnd(hwnd, "OK")
end
  $ie.wait()

  assert(!$ie.contains_text('rewriteblog'))
      
=begin
	$ie.link(:text, 'Control Panel').click
	$ie.link(:text, 'My Blogs').click
	$ie.goto('http://localhost/cs/ControlPanel/Blogs/postlist.aspx')
	$ie.link(:text, 'Delete').click_no_wait
  hwnd = $ie.enabled_popup(5)
  if(hwnd)
  w = WinClicker.new
  w.clickWindowsButton_hwnd(hwnd, "OK")
  end
puts "test_48_DeleteBlogUsingBlogGroups_Blogs Passed"
	$ie.goto($UniVar)      
=end
	end
end